package com.example.birdfriends.service.impl;

import com.example.birdfriends.dao.FollowDao;
import com.example.birdfriends.pojo.follow.Follower;
import com.example.birdfriends.service.FollowService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class FollowServiceImpl implements FollowService {
    @Autowired
    private FollowDao followDao = null;

    @Override
    public int addFollow(Follower follower) {  // 关注用户
        return followDao.addFollow(follower);
    }

    @Override
    public List<Long> findFollowedUidsByCurUid(Long curLoginUid) {
        return followDao.findFollowedUidsByCurUid(curLoginUid);
    }

    @Override
    public Long findFidByCurUidAndFollowedUid(Long curLoginUid, Long followedUid) {
        return followDao.findFidByCurUidAndFollowedUid(curLoginUid, followedUid);
    }

    @Override
    public int deleteFollowByFid(Long fid) {
        return followDao.deleteFollowByFid(fid);
    }
}
